package com.wpen.unit.cvt.system;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.wpen.unit.infra.mybatis.system.po.UserPo;
import com.wpen.unit.web.dto.system.SysUserAddRequest;
import com.wpen.unit.web.dto.system.SysUserListRequest;
import com.wpen.unit.web.dto.system.SysUserListRowsResponse;
import com.wpen.unit.web.dto.system.SysUserModRequest;
import com.wpen.unit.web.dto.system.UserInfoResponse;

/**
 * 用户转换类
 * 
 * @author Wang Peng
 * @date 2022-12-22
 *
 */
@Mapper
public interface UserCvt {
    UserCvt INSTANCE = Mappers.getMapper(UserCvt.class);

    UserInfoResponse queryDto2Do(UserPo userPo);

    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyyMMdd")
    UserPo addUserDto2Do(SysUserAddRequest userAddParam);

    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyyMMdd")
    UserPo modUserDto2Do(SysUserModRequest sysUserModParam);

    UserPo queryListDto2Do(SysUserListRequest sysUserListParam);

    SysUserListRowsResponse queryListDo2Dto(UserPo userPo);
}
